@import "../css/var";

.popup-wrapper {
  position: fixed;
  background: rgba(0, 0, 0, 0.5);
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.popup {
  border-radius: 0.05rem;
  padding: 0.15rem;
  background: #fff;
  box-shadow: 1px 1px 10px 0 rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  position: relative;
}

.middle {
  position: relative;
  width: 6rem;

  .close {
    display: block;
  }
}

.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: 0.1rem 0.1rem 0 0;
  border: 0;

}

.top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  border-radius: 0 0 0.1rem 0.1rem;
  border: 0;
}

.left,
.right {
  width: 70vw;
  height: 100vh;
  padding: 0.15rem;
  position: fixed;
  top: 0;
  border-radius: 0;
}

.left {
  left: 0;
}

.right {
  right: 0;
}

.close {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  height: 0.3rem;
  width: 0.3rem;
  line-height: 0.3rem;
  font-size: 0.25rem;
  cursor: pointer;
  text-align: center;
  color: #999;
  user-select: none;
}

.close:active {
  opacity: 0.8;
}

.popup-title {
  font-size: 0.18rem;
  margin-bottom: 0.15rem;
}

.center .popup-title {
  border-bottom: none;
}

.popup-content {
  flex: 1;
  /*max-height: calc(100vh - 1.5rem);*/
  overflow: auto;
  overscroll-behavior: contain;
}

.bottom .popup-content {
  /*max-height: calc(100vh - 3rem);*/
}

.operate {
  display: flex;
  justify-content: flex-end;
  margin: 0.2rem 0 0;
}

.fade-enter-active .popup,
.fade-leave-active .popup {
  transition: all 0.3s;
}

.fade-enter .middle,
.fade-leave-to .middle {
  transform: scale3d(.1, .1, .1);
}

.fade-enter .bottom,
.fade-leave-to .bottom {
  transform: translateY(100%);
}

.fade-enter .top,
.fade-leave-to .top {
  transform: translateY(-100%);
}

.fade-enter .left,
.fade-leave-to .left {
  transform: translateX(-100%);
}

.fade-enter .right,
.fade-leave-to .right {
  transform: translateX(100%);
}

@media screen and (max-width: 600px) {
  .middle {
    width: 90%;
  }
}
